﻿@using IterationLife.Extensions.EasyUI.GridColumns
@using IterationLife.FootballTeaching.Queries
@using Util.Ui
@model IterationLife.PlatformBackEnd.AppServices.Dtos.FootballTeachings.LessonDto
@{
    var x = @Html.EasyUi();
}
<script type="text/javascript">
    var dialog_lesson_Choice = function () {
        var selectedRow = $.easyui.getGrid("grid_dialog_lesson").etreegrid("getSelected");
        if (!selectedRow) {
            $.easyui.warn("至少选择一个");
            return;
        }
        $.easyui.refreshPanel("panel_lesson_form", "/FootballTeachings/Lesson/FormPanel?sortId=@(Model.SortId)&id=" + selectedRow.Id);
        $.easyui.closeDialog();
    }
</script>

@using (x.Layout(true).Begin())
{
    using (x.LayoutRegion().Center().Begin())
    {
        @Html.Partial("Dialogs/QueryForm", new LessonQuery())
        @(x.Grid("grid_dialog_lesson").Sort("SortId", false).Toolbar("divQuery_dialog_lesson").Url("/FootballTeachings/Lesson/PagerQuery")
        .ShowEditDialogByDblClick("btnEdit_dialog_lesson").Menu().FitColumns().Fit()
        .Columns(
            x.GridColumn(t => t.Name, 100),
            x.GridColumn(t => t.Banner, 100).AttachmentPreview(),
            x.GridColumn(t => t.Video, 100).AttachmentPreview(),
            x.GridColumn(t => t.Difficulty, 100),
            x.GridColumn(t => t.Requirement, 100),
            x.GridColumn(t => t.SortId, 100),
            x.GridColumn(t => t.CreationTime, 120)
        )
        )
    }
}

<div id="dialogButtons_lesson">
    @x.Button("保 存").Icon("icon-ok").Width(90).Click("dialog_lesson_Choice()")
    @x.DialogButton("关 闭").Icon("icon-cancel").Width(90).CloseDialog()
</div>
